import {createAction, createThunkAction} from "../../lib/redux-utils";
import {get, postJson} from "../../lib/http";
import {getPrincipal} from "../../lib/identity";

const principal = getPrincipal();
export const showCreate = createAction("TRANSPORT_TYPE.SHOW_CREATE");
export const hideCreate = createAction("TRANSPORT_TYPE.HIDE_CREATE");
export const updateModel = createAction("TRANSPORT_TYPE.UPDATE");

export const query = createThunkAction("TRANSPORT_TYPE.QUERY", params =>
    postJson("/transportType/getAll", params)
);
export const create = createThunkAction("TRANSPORT_TYPE.CREATE", params =>
    postJson("/transportType/create", params)
);
export const del = createThunkAction("", params =>
    get("/transportType/del/" + params + "/" + principal.id)
);

